package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class 砝码称重 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=10000010;
       static int a[]=new int[N],s[]=new int[N],n,cnt;
       static boolean st[]=new boolean[N];
       
       static void dfs(int i,int sum){
    	      if(i==n){
    	    	  if(sum>0&&!st[sum]){
    	    		  cnt++;
    	    		  st[sum]=true;
    	    	  }
    	    	  return;
    	      }
    	      dfs(i+1,sum-a[i]);//该砝码放左边
    	      dfs(i+1,sum);//不放该砝码
    	      dfs(i+1,sum+a[i]);//该砝码放右边
       }
       public static void main(String[] args) throws IOException {
		      n=Integer.parseInt(br.readLine());
		      String[]ss=br.readLine().split(" ");
		      for(int i=0;i<n;i++)
		    	  a[i]=Integer.parseInt(ss[i]);
		      dfs(0,0);
		      System.out.print(cnt);
	}
}
